/**
 * Created by linxiaofen on 2017/4/28.
 */
'use strict';
app.component('personalProfile', {
        templateUrl: './view/template/profile.html',
        controller: function (httpService, $timeout) {
            var ctrl = this;
            httpService.getProfile.query(function(data){
                ctrl.data = data;
            });
            angular.element(document).ready(function () {
                scrollBarsCtrl();
            });
            function scrollBarsCtrl() {
                if (window.matchMedia("(max-width: 800px)").matches) {
                    $("#profile").mCustomScrollbar("destroy");
                } else {
                    $("#profile").mCustomScrollbar({
                        theme: "dark-2",
                        contentTouchScroll: true,
                        advanced: {
                            updateOnContentResize: true,
                            updateOnBrowserResize: true,
                            autoScrollOnFocus: false
                        }
                    });
                }
            }

            //向下箭头按钮点击后改为向上
            $(".collapse_tabs").click(function () {

                if ($(this).hasClass('collapsed')) {
                    $(this).find('i.glyphicon').removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
                } else {
                    $(this).find('i.glyphicon').removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
                }

            });
        }
    });